package com.support.android.myapp3.domain;

import java.math.BigDecimal;

public class Test {
    public static void main(String[] args) {
        Test tt = new Test();
        BigDecimal c = new BigDecimal("3500");
        BigDecimal money = new BigDecimal("8977");
        BigDecimal per = new BigDecimal("35");
        tt.calcPer(c,money);
        tt.lastShow(money,per);
    }

    public BigDecimal calcPer(BigDecimal c , BigDecimal money){
        return c.divide(money, 2, BigDecimal.ROUND_HALF_UP).multiply(new BigDecimal("100"));
    }

    public String lastShow(BigDecimal money,BigDecimal per){
        return String.format("脱后月薪:比例%s%%:%s ",
                per.setScale(2, BigDecimal.ROUND_HALF_DOWN).toString(),
                money.setScale(2, BigDecimal.ROUND_HALF_DOWN).toString());
    }
}
